home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_ORBit.idb / usr / freeware / include / ORBitutil / util.h.z / util.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  715 b   |  36 lines

  1. #ifndef UTIL_H
  2. #define UTIL_H 1
  3.  
  4. #include <glib.h>
  5.  
  6. #define DEBUG 1
  7.  
  8. #ifdef DEBUG
  9. #define DEBUG_NOTE(x) (x)
  10. #else
  11. #define DEBUG_NOTE(x)
  12. #endif
  13.  
  14.  
  15. #define BitTest(f, bit)  ((f) & (1<<(bit)))
  16. #define BitSet(f, bit) ((f) |= (1<<(bit)))
  17. #define BitClr(f, bit) ((f) &= ~(1<<(bit)))
  18. /* Align an address upward to a boundary, expressed as a number of bytes.
  19.    E.g. align to an 8-byte boundary with argument of 8.  */
  20.  
  21. /*
  22.  *   (this + boundary - 1)
  23.  *          &
  24.  *    ~(boundary - 1)
  25.  */
  26.  
  27. #define ALIGN_ADDRESS(this, boundary) \
  28.   ((gpointer)((( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1)))))
  29.  
  30.  
  31. #include "thread-safety.h"
  32. #include "trace.h"
  33. #include "compat.h"
  34.  
  35. #endif
  36.